package com.nearby.demand.fragment;

import android.app.Activity;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.TextView;

import com.nearby.demand.R;


public class FragmentRelease extends BaseFragment implements OnClickListener,
        OnItemClickListener {
    private Activity ctx;
    private View layout;

    private TextView tv_text_v1, toolbar_title,tv_text_v3;


    @Override
    protected void lazyLoad() {


    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        if (layout == null) {
            ctx = this.getActivity();

            layout = ctx.getLayoutInflater().inflate(R.layout.ui_world_release,
                    null);

            tv_text_v1 = (TextView) layout.findViewById(R.id.tv_text_v1);
            toolbar_title = (TextView) layout.findViewById(R.id.toolbar_title);
            tv_text_v3 = (TextView) layout.findViewById(R.id.tv_text_v3);
            tv_text_v1.setVisibility(View.VISIBLE);
            tv_text_v3.setVisibility(View.VISIBLE);
            tv_text_v1.setText(getResources().getText(R.string.cancel));
            toolbar_title.setText(getResources().getText(R.string.release_demand));
            tv_text_v3.setText(getResources().getText(R.string.release));

        } else {
            ViewGroup parent = (ViewGroup) layout.getParent();
            if (parent != null) {
                parent.removeView(layout);
            }
        }
        return layout;
    }

    @Override
    public void onResume() {
        super.onResume();

    }


    @Override
    public void onItemClick(AdapterView<?> arg0, View arg1, int position,
                            long arg3) {
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            default:
                break;
        }
    }

}
